package liumengbaio.lolzhangyoubao.Activity.Activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import liumengbaio.lolzhangyoubao.R;

public class PayQuestionActivity extends AppCompatActivity {
    private boolean flag_vedio = true, flag_soft = true, flag_data = true, flag_pay = true, falg_advice = true, flag_relative = true, flag_geuss = true;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pay_question);
        iniView();
    }

    private void iniView() {
        findViewById(R.id.edit_head_left_title).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        findViewById(R.id.vedio_question).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (flag_vedio) {
                    findViewById(R.id.btn_vedio).setBackgroundResource(R.mipmap.album_photo_select);
                    flag_vedio = false;
                } else {
                    findViewById(R.id.btn_vedio).setBackgroundResource(R.mipmap.album_photo_unselect);
                    flag_vedio = true;
                }
            }
        });
        findViewById(R.id.soft_question).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (flag_soft) {
                    findViewById(R.id.btn_soft).setBackgroundResource(R.mipmap.album_photo_select);
                    flag_soft = false;
                } else {
                    findViewById(R.id.btn_soft).setBackgroundResource(R.mipmap.album_photo_unselect);
                    flag_soft = true;
                }
            }
        });
        findViewById(R.id.data_question).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (flag_data) {
                    findViewById(R.id.btn_data).setBackgroundResource(R.mipmap.album_photo_select);
                    flag_data = false;
                } else {
                    findViewById(R.id.btn_data).setBackgroundResource(R.mipmap.album_photo_unselect);
                    flag_data = true;
                }
            }
        });
        findViewById(R.id.pay_question).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (flag_pay) {
                    findViewById(R.id.btn_pay).setBackgroundResource(R.mipmap.album_photo_select);
                    flag_pay = false;
                } else {
                    findViewById(R.id.btn_pay).setBackgroundResource(R.mipmap.album_photo_unselect);
                    flag_pay = true;
                }
            }
        });
        findViewById(R.id.advice_question).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (falg_advice) {
                    findViewById(R.id.btn_advice).setBackgroundResource(R.mipmap.album_photo_select);
                    falg_advice = false;
                } else {
                    findViewById(R.id.btn_advice).setBackgroundResource(R.mipmap.album_photo_unselect);
                    falg_advice = true;
                }
            }
        });
        findViewById(R.id.geuss_question).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (flag_geuss) {
                    findViewById(R.id.btn_geuss).setBackgroundResource(R.mipmap.album_photo_select);
                    falg_advice = false;
                } else {
                    findViewById(R.id.btn_geuss).setBackgroundResource(R.mipmap.album_photo_unselect);
                    falg_advice = true;
                }
            }
        });
        findViewById(R.id.relative_question).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (flag_relative) {
                    findViewById(R.id.btn_relative).setBackgroundResource(R.mipmap.album_photo_select);
                    falg_advice = false;
                } else {
                    findViewById(R.id.btn_relative).setBackgroundResource(R.mipmap.album_photo_unselect);
                    falg_advice = true;
                }
            }
        });
    }
}
